<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //转换布尔类型
        //Boolean()
        console.log(Boolean(''));//flase
        console.log(Boolean(12));//true
        console.log(Boolean('giao'));//true
        console.log(Boolean(null));//flase
        console.log(Boolean(undefined));//flase
        console.log(Boolean(NaN));//flase
        //所有数值全为真，0除外。所有字符串全为真，''为假(注意' '有空格的也算字符串，结果为true)。 其余全部是假的。




        //不加三方变量来交换变量的值
        var a = 10
        var b = 20
        a = a + b;
        b = a - b;
        a = a - b;
        console.log(a);
        console.log(b);
    </script>
</body>
</html>